import Vue, { VueElement } from 'vue'

import {GetFormatShortDate,GetFormatFullDate,GetFormatHMSDate,FullConvertUrlArray,GetTimeDifference} from './comm.js'
Vue.filter('pictureFilter',function(value){
	
	if(!value) return '';
	if(!value.includes("http://")||!value.includes("https://")){
		value=value+"?v="+new Date().getTime();
		return value;
	}
})

Vue.filter('RepalceHtml',function(value){
	if(!value) return '';
	   return value.replace(/<[^>]+>|&[^>]+;/g, "").trim();//去掉所有的html标签和&nbsp;之类的特殊符合return str;}text = repalceHtml(text);
})

Vue.filter('fullConvertUrlArray',function(value){

	return FullConvertUrlArray(value);
})

  
Vue.filter('GetFormatShortDate',function(value){
	if(!value) return '';
		var date=new Date(value);
	return GetFormatShortDate(date);
})
Vue.filter('GetFormatFullDate',function(value){
	if(!value) return '';
	var date=new Date(value);
	return GetFormatFullDate(date);
})
Vue.filter('GetFormatFullDate',function(value){
	if(!value) return '';
	var date=new Date(value);
	return GetFormatFullDate(date);
})

Vue.filter('GetFormatHMSDate',function(value){
	if(!value) return '';
	var date=new Date(value);
	return GetFormatHMSDate(date);
})
Vue.filter('GetTimeDifference',function(value){
	if(!value) return '';
	var date=new Date(value);
	return GetTimeDifference(date);
})


